{namespace Pond.Tutor.soy}

/**
 * This is a Closure Template.
 *
 * To regenerate just English, run:
 *   make pond-tutor-en
 *
 * To regenerate all languages, run:
 *   make languages
 */

/**
 * Translated messages for use in JavaScript.
 */
{template .messages}
  {call Pond.soy.messages /}
  <div style="display: none">
    <span id="Pond_playerName">{{msg meaning="Pond.playerName" desc="Generic name for the player of this video game.\n{lb}{lb}Identical|Player{rb}{rb}"}}Player{{/msg}}</span>
    <span id="Pond_targetName">{{msg meaning="Pond.targetName" desc="Name for a player that does nothing.\n{lb}{lb}Identical|Target{rb}{rb}"}}Target{{/msg}}</span>
    <span id="Pond_pendulumName">{{msg meaning="Pond.pendulumName" desc="Name for a player that moves back and forth.\n{lb}{lb}Identical|Pendulum{rb}{rb}"}}Pendulum{{/msg}}</span>
    <span id="Pond_scaredName">{{msg meaning="Pond.scaredName" desc="Name for a player that is scared.\n{lb}{lb}Identical|Scared{rb}{rb}"}}Scared{{/msg}}</span>
  </div>
{/template}

/**
 * Web page structure.
 */
{template .start}
  {call .messages /}
  <table width="100%">
    <tr>
      <td>
        <h1>
          {call BlocklyGames.soy.titleSpan}
            {param appName}
              {msg meaning="Games.pondTutor" desc="IBID"}Pond Tutor{/msg}
            {/param}
          {/call}
          {call BlocklyGames.soy.levelLinks}
            {param level: $ij.level /}
            {param maxLevel: $ij.maxLevel /}
            {param lang: $ij.lang /}
            {param suffix}{/param}
          {/call}
        </h1>
      </td>
      <td class="farSide">
        <select id="languageMenu"></select>
        &nbsp;
        <button id="linkButton" title="{msg meaning="Games.linkTooltip" desc="IBID"}Save and link to blocks.{/msg}">
          <img src="common/1x1.gif" class="link icon21">
        </button>
        &nbsp;
        <button id="helpButton">
          {{msg meaning="Games.help" desc="IBID"}}Help{{/msg}}
        </button>
      </td>
    </tr>
  </table>

  {call Pond.soy.visualization /}

  {switch $ij.level}
    {case 1, 3, 5, 7, 9}
      {call .toolbox /}
      <div id="blockly"></div>
    {case 2, 4, 6, 8, 10}
      <div id="editor"></div>
  {/switch}

  {call .playerTarget /}
  {call .playerPendulum /}
  {call .playerScared /}

  {call BlocklyGames.soy.dialog /}
  {call BlocklyGames.soy.doneDialog /}
  {call BlocklyGames.soy.storageDialog /}

  {if $ij.level == 5 or $ij.level == 6}
  /**
   * Help dialog for idiotic level 5+6 solution.
   */
    <div id="helpUseScan" class="dialogHiddenContent">
      <div style="padding-bottom: 0.7ex">
        {msg meaning="Pond.helpUseScan" desc="Dialog telling user to seek a better answer.  Do not translate the word 'scan'."}
          Your solution works, but you can do better. Use 'scan' to tell the cannon how far to shoot.
        {/msg}
      </div>
      {call BlocklyGames.soy.ok /}
    </div>
  {/if}

  <div id="help" class="dialogHiddenContent">
    <div style="padding-bottom: 0.7ex">
      {if $ij.level == 1 or $ij.level == 2}
        {msg meaning="Pond.helpText1"
             desc="Instructions. Do not translate the word 'cannon'."}
          Use the 'cannon' command to hit the target. The first parameter
          is the angle, the second parameter is the range. Find the right
          combination.
        {/msg}
        {if $ij.level == 1}
          <br><br>
          <svg height="41" width="250">
            <g>
              <path transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z M 193.4,5 h -38.31 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31 z"></path>
              <path fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z M 193.4,5 h -38.31 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31 z"></path>
              <path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 221.86 M 2.69,33.3 A 7.5,7.5 0 0,1 0.5,28 V 8 M 125.51,5.5 v 27 h -36.02 M 83.89,24.3 l 3.68,-2.1 M 193.9,5.5 v 27 h -38.31 M 149.99,24.3 l 3.68,-2.1"></path>
              <g transform="translate(89.99,6)">
                <path transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.52 M 33.52,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="24.02"></rect>
                  <text class="blocklyText" y="12.5">0
                  <tspan>°</tspan></text>
                </g>
              </g>
              <g transform="translate(156.09,6)">
                <path transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 36.31 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#bdc2db" d="m 0,0 H 36.31 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 35.81 M 35.81,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="26.31"></rect>
                  <text class="blocklyText" y="12.5">70</text>
                </g>
              </g>
              <text class="blocklyText" y="12.5" transform="translate(10,10)">cannon</text>
              <text class="blocklyText" y="12.5" transform="translate(68.11,10)">(</text>
              <text class="blocklyText" y="12.5" transform="translate(135.01,10)">,</text>
              <text class="blocklyText" y="12.5" transform="translate(203.4,10)">);</text>
            </g>
          </svg>
        {elseif $ij.level == 2}
          <pre>cannon(0, 70);</pre>
        {/if}
      {elseif $ij.level == 3 or $ij.level == 4}
        {msg meaning="Pond.helpText2"
             desc="Instructions.  Do not translate 'while (true)'."}
          This target needs to be hit many times. Use a 'while (true)' loop
          to do something indefinitely.
        {/msg}
        {if $ij.level == 3}
          <br><br>
          <svg height="92" width="250">
            <g>
              <path transform="translate(1,1)" fill="#498449" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 162.94 v 36 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 129.08,5 h -60.71 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 60.71 z"></path>
              <path fill="#5ba55b" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 162.94 v 36 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 129.08,5 h -60.71 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 60.71 z"></path>
              <path class="blocklyPathLight" stroke="#8cc08c" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 49.5 M 49.5,0.5 H 162.44 M 49.5,36.5 M 21.98,59.01 a 8.5,8.5 0 0,0 6.01,2.48 H 49.5 M 49.5,61.5 H 49.5 M 2.69,83.3 A 7.5,7.5 0 0,1 0.5,78 V 8 M 129.58,5.5 v 27 h -60.71 M 63.27,24.3 l 3.68,-2.1"></path>
              <text class="blocklyText" y="12.5" transform="translate(10,10)">while&#160;(</text>
              <text class="blocklyText" y="12.5" transform="translate(139.08,10)">)&#160;{lb}</text>
              <text class="blocklyText" y="12.5" transform="translate(10,66)">{rb}</text>
              <g transform="translate(69.37,6)">
                <path transform="translate(1,1)" fill="#496684" d="m 0,0 H 58.71 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#5b80a5" d="m 0,0 H 58.71 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 58.21 M 58.21,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: default;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="48.71"></rect>
                  <text class="blocklyText" y="12.5" text-anchor="start" x="0">true
                  <tspan style="fill: rgb(91, 128, 165);"> ▾</tspan></text>
                </g>
              </g>
            </g>
          </svg>
        {elseif $ij.level == 4}
          <pre>while (true) {lb}{\n}
{sp}{sp}...{\n}
{rb}</pre>
        {/if}
      {elseif $ij.level == 5 or $ij.level == 6}
        {msg meaning="Pond.helpText3a"
             desc="Instructions.  Do not translate 'scan'."}
          This opponent moves back and forth, making it hard to hit.
          The 'scan' expression returns the exact range to the opponent
          in the specified direction.
        {/msg}
        {if $ij.level == 5}
          <br><br>
          <svg height="37" width="250">
            <g transform="translate(8,0)">
              <path transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 20 H 132.76 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z"></path>
              <path fill="#995ba5" d="m 0,0 H 20 H 132.76 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z"></path>
              <path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 132.26 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 108.38,5.5 v 27 h -36.02 M 66.76,24.3 l 3.68,-2.1"></path>
              <g transform="translate(72.86,6)">
                <path transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.52 M 33.52,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="24.02"></rect>
                  <text class="blocklyText" y="12.5">0
                  <tspan>°</tspan></text>
                </g>
              </g>
              <text class="blocklyText" y="12.5" transform="translate(10,10)">scan</text>
              <text class="blocklyText" y="12.5" transform="translate(50.97,10)">(</text>
              <text class="blocklyText" y="12.5" transform="translate(117.88,10)">)</text>
            </g>
          </svg>
          <br><br>
        {elseif $ij.level == 6}
          <pre>scan(0)</pre>
        {/if}
        {msg meaning="Pond.helpText3b"
             desc="Instructions.  Do not translate 'cannon'."}
          This range is exactly what the 'cannon' command needs to fire
          accurately.
        {/msg}
      {elseif $ij.level == 7 or $ij.level == 8}
        {msg meaning="Pond.helpText4"
             desc="Instructions.  Do not translate the word 'swim'."}
          This opponent is too far away to use the cannon (which has a limit of
          70 meters). Instead, use the 'swim' command to start swimming
          towards the opponent and crash into it.
        {/msg}
        {if $ij.level == 7}
          <br><br>
          <svg height="41" width="250">
            <g>
              <path transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.25 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.3,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z"></path>
              <path fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.25 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.3,5 h -36.02 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.02 z"></path>
              <path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 138.75 M 2.69,33.3 A 7.5,7.5 0 0,1 0.5,28 V 8 M 110.8,5.5 v 27 h -36.02 M 69.18,24.3 l 3.68,-2.1"></path>
              <g transform="translate(75.28,6)">
                <path transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#bdc2db" d="m 0,0 H 34.02 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.52 M 33.52,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="24.02"></rect>
                  <text class="blocklyText" y="12.5">0
                  <tspan>°</tspan></text>
                </g>
              </g>
              <text class="blocklyText" y="12.5" transform="translate(10,10)">swim</text>
              <text class="blocklyText" y="12.5" transform="translate(53.39,10)">(</text>
              <text class="blocklyText" y="12.5" transform="translate(120.3,10)">);</text>
            </g>
          </svg>
        {elseif $ij.level == 8}
          <pre>swim(0);</pre>
        {/if}
      {elseif $ij.level == 9}
        {msg meaning="Pond.helpText5"
             desc="Instructions.  Do not translate the word 'stop'."}
          This opponent is also too far away to use the cannon. But you are
          too weak to survive a collision. Swim towards the opponent while
          your horizontal location is less than than 50. Then 'stop' and use
          the cannon.
        {/msg}
        {if $ij.level == 9}
          <br><br>
          <svg height="37" width="250">
            <g transform="translate(8,0)">
              <path transform="translate(1,1)" fill="#496684" d="m 0,0 H 20 H 194.25 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 97.93,5 h -81.93 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 81.93 z M 184.25,5 h -38.31 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31 z"></path>
              <path fill="#5b80a5" d="m 0,0 H 20 H 194.25 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 97.93,5 h -81.93 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 81.93 z M 184.25,5 h -38.31 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31 z"></path>
              <path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 193.75 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 98.43,5.5 v 26 h -81.93 M 10.9,24.3 l 3.68,-2.1 M 184.75,5.5 v 27 h -38.31 M 140.83,24.3 l 3.68,-2.1"></path>
              <g class="blocklyEditableText" transform="translate(107.93,10)" style="cursor: default;">
                <rect rx="4" ry="4" x="-5" y="0" height="16" width="32.0"></rect>
                <text class="blocklyText" y="12.5" text-anchor="start" x="0">&lt;
                <tspan style="fill: rgb(91, 128, 165);"> ▾</tspan></text>
              </g>
              <g transform="translate(146.93,6)">
                <path transform="translate(1,1)" fill="#495284" d="m 0,0 H 36.31 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#5b67a5" d="m 0,0 H 36.31 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 35.81 M 35.81,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;">
                  <rect rx="4" ry="4" x="-5" y="0" height="16" width="26.31"></rect>
                  <text class="blocklyText" y="12.5">50</text>
                </g>
              </g>
              <g transform="translate(17,6)">
                <path transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 79.93 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path fill="#995ba5" d="m 0,0 H 79.93 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path>
                <path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 79.43 M 79.43,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path>
                <text class="blocklyText" y="12.5" transform="translate(10,5)">getX</text>
                <text class="blocklyText" y="12.5" transform="translate(50.16,5)">(</text>
                <text class="blocklyText" y="12.5" transform="translate(65.05,5)">)</text>
              </g>
            </g>
          </svg>
          <br><br>
            <svg height="31" width="250">
              <g>
                <path transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path>
                <path fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path>
                <path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 81.06 M 81.06,0.5 M 2.69,21.3 A 7.5,7.5 0 0,1 0.5,16 V 8"></path>
                <text class="blocklyText" y="12.5" transform="translate(10,5)">stop</text>
                <text class="blocklyText" y="12.5" transform="translate(47.71,5)">(</text>
                <text class="blocklyText" y="12.5" transform="translate(62.6,5)">);</text>
              </g>
            </svg>
        {elseif $ij.level == 10}
          <pre>getX() &lt; 50</pre>
          <pre>stop();</pre>
        {/if}
      {elseif $ij.level == 10}
        {msg meaning="Pond.helpText6"
             desc="Instructions."}
          This opponent will move away when it is hit. Swim towards it if it
          is out of range (70 meters).
        {/msg}
      {/if}
    </div>
    {call BlocklyGames.soy.ok /}
  </div>
{/template}

/**
 * Toolbox.
 */
{template .toolbox}
  <xml id="toolbox" xmlns="https://developers.google.com/blockly/xml">
    <category name="{msg meaning="Games.pond" desc="IBID"}Pond{/msg}">
      <block type="pond_cannon">
        <value name="DEGREE">
          <shadow type="pond_math_number">
            <mutation angle_field="true"></mutation>
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="RANGE">
          <shadow type="pond_math_number">
            <mutation angle_field="false"></mutation>
            <field name="NUM">70</field>
          </shadow>
        </value>
      </block>
  {if $ij.level >= 5}
      <block type="pond_scan">
        <value name="DEGREE">
          <shadow type="pond_math_number">
            <mutation angle_field="true"></mutation>
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
  {/if}
  {if $ij.level >= 7}
      <block type="pond_swim">
        <value name="DEGREE">
          <shadow type="pond_math_number">
            <mutation angle_field="true"></mutation>
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
  {/if}
  {if $ij.level >= 9}
      <block type="pond_stop"></block>
  {/if}
  {if $ij.level >= 9}
      <block type="pond_getX"></block>
      <block type="pond_getY"></block>
  {/if}
    </category>
{if $ij.level >= 3}
    <category name="{msg meaning="Games.catLogic" desc="IBID"}Logic{/msg}">
  {if $ij.level >= 9}
      <block type="controls_if"></block>
      <block type="logic_compare"></block>
  {/if}
      <block type="logic_boolean"></block>
    </category>
    <category name="{msg meaning="Games.catLoops" desc="IBID"}Loops{/msg}">
      <block type="controls_whileUntil"></block>
    </category>
{/if}
    <category name="{msg meaning="Games.catMath" desc="IBID"}Math{/msg}">
      <block type="pond_math_number">
        <mutation angle_field="false"></mutation>
      </block>
    </category>
  </xml>
{/template}

/**
 * Target.
 */
{template .playerTarget}
{literal}
<div id="playerTarget" style="display: none">
</div>
{/literal}
{/template}

/**
 * Pendulum.
 */
{template .playerPendulum}
{literal}
<div id="playerPendulum" style="display: none">
/* Slowly moves east and west.  Does not fire. */
var west = false;
while (true) {
  if (west) {
    if (getX() > 25) {
      swim(180, 25);
    } else {
      west = false;
      swim(0, 0);
    }
  } else {
    if (getX() < 75) {
      swim(0, 25);
    } else {
      west = true;
      swim(0, 0);
    }
  }
}
</div>
{/literal}
{/template}


/**
 * Scared.
 */
{template .playerScared}
{literal}
<div id="playerScared" style="display: none">
/* Moves south-west when hit.  Does not fire. */
var d = damage();
while (true) {
  if (d != damage()) {
    swim(45, 100);
    var t = 0;
    for (var t = 0; t < 100; t++) {}
    d = damage();
    stop();
  }
}
</div>
{/literal}
{/template}
